﻿package com.tudou.utils
{

    public class RandString extends Object
    {
        private static const chars:String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

        public function RandString()
        {
            return;
        }// end function

        public static function get randId() : String
        {
            return getString(20) + new Date().time.toString(32);
        }// end function

        public static function get noCache() : String
        {
            return String((int(Math.random() * 100000) + 1));
        }// end function

        public static function get randIntId() : String
        {
            return String((int(Math.random() * 100000000) + 1));
        }// end function

        public static function getString(param1:uint) : String
        {
            var _loc_4:uint = 0;
            var _loc_2:String = "";
            var _loc_3:* = chars.length;
            var _loc_5:int = 0;
            while (_loc_5 < param1)
            {
                
                _loc_4 = uint(Math.random() * _loc_3);
                _loc_2 = _loc_2 + chars.charAt(_loc_4);
                _loc_5++;
            }
            return _loc_2;
        }// end function

    }
}
